﻿using AvaloniaDevice.Common.WIFI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AvaloniaDevice.Common.Services
{
    /// <summary>
    /// WiFi服务接口，定义跨平台WiFi操作
    /// </summary>
    public interface IWifiService
    {
        /// <summary>
        /// 检查WiFi是否开启
        /// </summary>
        bool IsWifiEnabled();

        /// <summary>
        /// 开启或关闭WiFi
        /// </summary>
        Task SetWifiEnabled(bool enabled);

        /// <summary>
        /// 获取附近可用WiFi列表
        /// </summary>
        Task<List<WifiInfo>> GetAvailableNetworks();

        /// <summary>
        /// 连接指定WiFi
        /// </summary>
        Task<bool> ConnectToWifi(string ssid, string password = null);

        /// <summary>
        /// 断开指定WiFi连接
        /// </summary>
        Task<bool> DisconnectFromWifi(string ssid);

        /// <summary>
        /// 获取当前已连接的WiFi
        /// </summary>
        WifiInfo GetConnectedWifi();

        /// <summary>
        /// 检查平台是否支持WiFi管理
        /// </summary>
        bool IsSupported { get; }

        /// <summary>
        /// 平台特定的限制说明
        /// </summary>
        string PlatformRestrictions { get; }
    }
}
